package com.captjack.micro.task.job;

import com.dangdang.ddframe.job.api.simple.SimpleJob;
import com.dangdang.ddframe.job.config.JobCoreConfiguration;
import com.dangdang.ddframe.job.config.simple.SimpleJobConfiguration;
import com.dangdang.ddframe.job.lite.config.LiteJobConfiguration;

/**
 * 自定义SimpleJob
 *
 * @author Jack Sparrow
 * @version 1.0.0
 * @date 2018/7/22 02:12
 * package com.captjack.micro.task.job
 */
public interface SimpleJobSupport extends SimpleJob {

    /**
     * getLiteJobConfiguration
     *
     * @return 当前任务的配置
     */
    default LiteJobConfiguration getLiteJobConfiguration() {
        return LiteJobConfiguration.newBuilder(new SimpleJobConfiguration(getJobCoreConfiguration(), getJobCoreConfiguration().getJobName())).build();
    }

    /**
     * getJobCoreConfiguration
     *
     * @return 当前任务的配置
     */
    JobCoreConfiguration getJobCoreConfiguration();

}
